<?php
/**
 * Created by PhpStorm.
 * User: hexvliang
 * Date: 2015/10/20
 * Time: 18:16
 */

namespace Org\Sentry;

require 'Raven/Autoloader.php';
\Raven_Autoloader::register();

/**
 *
 * Class Sentry
 * @package Org\Sentry
 */
class Sentry
{
    /**
     * @var \Raven_Client
     */
    private static $sentry;

    private function __construct()
    {
        // TODO: Implement __construct() method.
    }

    /**
     * 获取sentry的实体
     * @param $dsn sentry的服务器地址
     * @param $option array 配置
     * @return \Raven_Client
     */
    public static function getInstance($dsn,$option)
    {
        if(empty(self::$sentry)){
            self::$sentry=new \Raven_Client($dsn,$option);
        }
        return self::$sentry;
    }


}